import math
a, b = map(int, input().strip().split())
if a < 100:
    a = 100
if b > 999:
    b = 999

for i in range(a, b+1):
    x = i % 10
    y = i//10 % 10
    z = i//100
    if x*x*x+y*y*y+z*z*z == i and i >= 100 and i <= 999:
        print(i)
